#include"vector.h"

void PushBack_Test()
{
	cout << "You are testing PushBack() now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of vector: " << v1.Size()<< endl;
	#endif
	cout << endl;
}

void PopBack_Test()
{
	cout << "You are testing PopBack() now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of origin vector v1: " << v1.Size()<< endl;
	#endif
	v1.PopBack();
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of vector after v1.PopBack(): " << v1.Size()<< endl;
	#endif
	cout << endl;
}

void clear_Test()
{
	cout << "You are testing clear() now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of origin vector v1: " << v1.Size()<< endl;
	#endif
	v1.clear();
	#ifdef DEBUG
		cout << "Size of vector after v1.clear(): " << v1.Size()<< endl;
	#endif
	cout << endl;
}

void at_Test()
{
	cout << "You are testing at() now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of origin vector v1: " << v1.Size()<< endl;
	#endif
	cout << "return v1.at(0): " << v1.at(0) << endl;
	cout << endl;
}

void operator_Test()
{
	cout << "You are testing [] now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of origin vector v1: " << v1.Size()<< endl;
	#endif
	cout << "return v1[0]: " << v1[0] << endl;
	cout << endl;
}


void copy_constructor_Test()
{
	cout << "You are testing copy constructor now:" << endl;
	Vector<int> v1;
	v1.PushBack(1);
	v1.PushBack(2);
	v1.PushBack(3);
	v1.PushBack(4);
	v1.PushBack(5);
	for (size_t i = 0; i < v1.Size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of origin vector v1: " << v1.Size()<< endl;
	#endif
	Vector<int> v2(v1);
	for (size_t i = 0; i < v2.Size(); ++i)
	{
		cout << v2[i] << " ";
	}
	cout << endl;
	#ifdef DEBUG
		cout << "Size of copied vector v2(v1): " << v2.Size()<< endl;
	#endif
}
